package com.star.blog.utils;


import com.star.blog.pojo.SysUser;

public class UserThreadLocal {

    private UserThreadLocal(){}
    //线程变量隔离
    private static final ThreadLocal<SysUser> LOCAL = new ThreadLocal<>();

    /**
     * 放入
     * @param sysUser
     */
    public static void put(SysUser sysUser){
        LOCAL.set(sysUser);
    }

    /**
     * 取出来
     * @return
     */
    public static SysUser get(){
        return LOCAL.get();
    }

    /**
     * 删除
     */
    public static void remove(){
        LOCAL.remove();
    }
}
